package com.itheima.hw.test01;

/**
 * 猴子摘桃：
 *      f(n) = (f(n+1)+1)*2
 *
 *      f(9) =  ( f(10) + 1 ) * 2
 *
 *      10 = 1
 */
public class Test {

    public static int f(int n){
        //2.设置终结点
        if(n==10) return 1;
        //1.套公式
        return (f(n+1)+1)*2;  //3.会走向终结点
    }

    public static void main(String[] args) {
        System.out.println(f(1));
    }


}
